﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace PL.Models
{
    /// <summary>
    /// Summary description for SellFunnelData
    /// </summary>
    public class SellFunnelData
    {
        public SellFunnelData()
        {
            this.InitialContact = "0";
            this.Negotiating = "0";
            this.Prospect = "0";
            this.QualifiedProspect = "0";
            this.WeHaveADeal = "0";
        }

        public string WorkerId
        {
            get;
            set;
        }

        public string Worker
        {
            get;
            set;
        }

        public string InitialContact
        {
            get;
            set;
        }

        public string Prospect
        {
            get;
            set;
        }

        public string QualifiedProspect
        {
            get;
            set;
        }

        public string Negotiating
        {
            get;
            set;
        }

        public string WeHaveADeal
        {
            get;
            set;
        }

        public void Add(SellFunnelData data)
        {
            int buffer = 0;
            int current = 0;
            try
            {
                current = int.Parse(this.InitialContact);
                buffer = int.Parse(data.InitialContact);
                this.InitialContact = "" + (current + buffer);
            }
            catch { }

            try
            {
                current = int.Parse(this.Negotiating);
                buffer = int.Parse(data.Negotiating);
                this.Negotiating = "" + (current + buffer);
            }
            catch { }

            try
            {
                current = int.Parse(this.Prospect);
                buffer = int.Parse(data.Prospect);
                this.Prospect = "" + (current + buffer);
            }
            catch { }

            try
            {
                current = int.Parse(this.QualifiedProspect);
                buffer = int.Parse(data.QualifiedProspect);
                this.QualifiedProspect = "" + (current + buffer);
            }
            catch { }

            try
            {
                current = int.Parse(this.WeHaveADeal);
                buffer = int.Parse(data.WeHaveADeal);
                this.WeHaveADeal = "" + (current + buffer);
            }
            catch { }
        }
    }
}